home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / gui / mui / mui14-dv.lha / MUI / Developer / Autodocs / MUI_Application.doc next >
Encoding:
Text File  |  1993-10-28  |  30.1 KB  |  1,031 lines

  1. TABLE OF CONTENTS
  2.  
  3. Application.mui/Application.mui
  4. Application.mui/MUIM_Application_GetMenuCheck
  5. Application.mui/MUIM_Application_GetMenuState
  6. Application.mui/MUIM_Application_Input
  7. Application.mui/MUIM_Application_InputBuffered
  8. Application.mui/MUIM_Application_Load
  9. Application.mui/MUIM_Application_PushMethod
  10. Application.mui/MUIM_Application_ReturnID
  11. Application.mui/MUIM_Application_Save
  12. Application.mui/MUIM_Application_SetMenuCheck
  13. Application.mui/MUIM_Application_SetMenuState
  14. Application.mui/MUIM_Application_ShowHelp
  15. Application.mui/MUIA_Application_Active
  16. Application.mui/MUIA_Application_Author
  17. Application.mui/MUIA_Application_Base
  18. Application.mui/MUIA_Application_Broker
  19. Application.mui/MUIA_Application_BrokerHook
  20. Application.mui/MUIA_Application_BrokerPort
  21. Application.mui/MUIA_Application_BrokerPri
  22. Application.mui/MUIA_Application_Commands
  23. Application.mui/MUIA_Application_Copyright
  24. Application.mui/MUIA_Application_Description
  25. Application.mui/MUIA_Application_DiskObject
  26. Application.mui/MUIA_Application_DoubleStart
  27. Application.mui/MUIA_Application_DropObject
  28. Application.mui/MUIA_Application_Iconified
  29. Application.mui/MUIA_Application_Menu
  30. Application.mui/MUIA_Application_MenuAction
  31. Application.mui/MUIA_Application_MenuHelp
  32. Application.mui/MUIA_Application_RexxMsg
  33. Application.mui/MUIA_Application_RexxString
  34. Application.mui/MUIA_Application_SingleTask
  35. Application.mui/MUIA_Application_Sleep
  36. Application.mui/MUIA_Application_Title
  37. Application.mui/MUIA_Application_Version
  38. Application.mui/MUIA_Application_Window
  39. Application.mui/Application.mui
  40.  
  41. Application class is the master class for all
  42. MUI applications. It serves as a kind of anchor
  43. for all input, either coming from the user or
  44. somewhere from the system, e.g. commodities
  45. or ARexx messages.
  46.  
  47. An application can have any number of sub windows,
  48. these windows are the children of the application.
  49. Application.mui/MUIM_Application_GetMenuCheck
  50.  
  51.     NAME
  52.     MUIM_Application_GetMenuCheck
  53.  
  54.     SYNOPSIS
  55.     DoMethod(obj,MUIM_Application_GetMenuCheck,ULONG MenuID);
  56.  
  57.     FUNCTION
  58.     Ask whether a checkmark menu item has its checkmark
  59.     set or cleared.
  60.     The application will ask its sub windows for a
  61.     menu item with the given id and return the state of
  62.     the first item it finds.
  63.  
  64.     INPUTS
  65.     MenuID - the value you wrote into the
  66.                  UserData field of struct NewMenu.
  67.  
  68.     SEE ALSO
  69.     MUIM_Application_SetMenuCheck, MUIA_Application_Menu
  70. Application.mui/MUIM_Application_GetMenuState
  71.  
  72.     NAME
  73.     MUIM_Application_GetMenuState
  74.  
  75.     SYNOPSIS
  76.     DoMethod(obj,MUIM_Application_GetMenuState,ULONG MenuID);
  77.  
  78.     FUNCTION
  79.     Ask whether a menu item is enabled or disabled.
  80.     The application will ask its sub windows for a
  81.     menu item with the given id and return the state of
  82.     the first item it finds.
  83.  
  84.     INPUTS
  85.     MenuID - the value you wrote into the
  86.                  UserData field of struct NewMenu.
  87.  
  88.     SEE ALSO
  89.     MUIM_Application_SetMenuState, MUIA_Application_Menu
  90. Application.mui/MUIM_Application_Input
  91.  
  92.     NAME
  93.     MUIM_Application_Input
  94.  
  95.     SYNOPSIS
  96.     DoMethod(obj,MUIM_Application_Input,LONGBITS *signal);
  97.  
  98.     FUNCTION
  99.     The MUI system itself does not wait for any user input.
  100.     It just tells your application which signal bits it
  101.     has allocated, then it's up to you to call MUIs input
  102.     handle function when one of these signals gets set.
  103.  
  104.     In a simple MUI application you would just Wait()
  105.     for these signals and call MUI when one is received.
  106.     However, you can perfectly allocate some signal bits
  107.     yourself and include them in your Wait() command.
  108.     You needn't even Wait(), your application could
  109.     maybe calculate some fractal graphics or copy
  110.     disks, the only important thing is that you call
  111.     MUI's input method when one of the MUI allocated
  112.     signals arrives.
  113.  
  114.     The usual way of communication with your user
  115.     interface is via return ids. Every action happening
  116.     to the GUI can create return ids, e.g. pressing a
  117.     button or trying to close a window. MUI buffers these
  118.     ids and uses them as result codes for the input method.
  119.     Thats where you can get it from and take the appropriate
  120.     actions.
  121.  
  122.     Now lets have a look on a usual input loop of a
  123.     MUI application. Imagine you have an Play and a
  124.     Cancel button and have previously told them
  125.     to return ID_PLAY and ID_CANCEL when pressed.
  126.     (see MUIM_Notify and MUIM_Application_ReturnID
  127.     on information about these topics). Your input
  128.     loop would look like this:
  129.  
  130.  
  131.     while (running)
  132.     {
  133.        ULONG signals;
  134.  
  135.        switch (DoMethod(app,MUIM_Application_Input,&signals))
  136.        {
  137.           case ID_PLAY:
  138.              PlaySound();
  139.              break;
  140.  
  141.           case ID_CANCEL:
  142.           case MUIV_Application_ReturnID_Quit:
  143.              running = FALSE;
  144.              break;
  145.        }
  146.  
  147.        if (running && signals) Wait(signals);
  148.     }
  149.  
  150.  
  151.     So what is happening here?
  152.  
  153.     First, you have to call the MUIM_Application_Input method.
  154.     You supply the address of a ULONG as parameter, thats
  155.     where MUI fills in the signals it needs. Note that you can
  156.     call the input method at any time, regardless of signal
  157.     setting. MUI will simply return when there is nothing
  158.     to do.
  159.  
  160.     In case the user pressed the Play or the Cancel button,
  161.     MUIM_Application_Input will return ID_PLAY or ID_CANCEL.
  162.     Otherwise you will receive a 0, that's why you cannot
  163.     use 0 as one of your id values.
  164.  
  165.     There is one predefined id called
  166.     MUIV_Application_ReturnID_Quit. This will be sent to you
  167.     when someone tried to quit your application from outside,
  168.     e.g. via commodities exchange or the ARexx "quit" command.
  169.     It is required that your application handles this id,
  170.     just treat as if the user clicked on a "Quit" button or
  171.     selected a "Quit" menu item.
  172.  
  173.     After handling the return value, you have to examine
  174.     if MUI wants you to wait for any signals. If this
  175.     is the case (signals != 0), just wait for it. If
  176.     MUI puts a 0 into signals it wants to tell you to
  177.     immediately call the input method again, maybe some
  178.     other return ids have received and need to be handled.
  179.     You *must* check this because Wait()ing on a zero
  180.     signal mask is not a good idea!
  181.  
  182.     Note: It is very important that you call the input method
  183.     whenever a signal arrives. MUI needs this to correctly
  184.     refresh its windows, handle resizing and iconification
  185.     operations and commodities and ARexx messages. If you
  186.     don't, you will annoy your user!
  187.  
  188.     If your program needs to be in a state where you are
  189.     for some reasons unable to call the input method for
  190.     a considerable amount of time (maybe half a second or
  191.     more), you should put your application to sleep. See
  192.     MUIA_Application_Sleep on how to do this.
  193.  
  194.     SEE ALSO
  195.     MUIA_Application_Sleep, MUIM_Application_InputBuffered
  196. Application.mui/MUIM_Application_InputBuffered
  197.  
  198.     NAME
  199.     MUIM_Application_InputBuffered
  200.  
  201.     SYNOPSIS
  202.     DoMethod(obj,MUIM_Application_InputBuffered,);
  203.  
  204.     FUNCTION
  205.     Imagine your application does some time consuming
  206.     operation, e.g. copying a disk, and you are for
  207.     some reasons unable to react on return ids during
  208.     this period. One solution would be to simply
  209.     put your application to sleep, it will get a
  210.     busy pointer and the user knows whats going on.
  211.  
  212.     However, this will make it impossible for the user
  213.     to resize your applications windows or iconify it,
  214.     he will have to wait until you are done with your
  215.     operation.
  216.  
  217.     MUIM_Application_InputBuffered offers a solution
  218.     for this problem. Using this method, you needn't
  219.     set to sleep your application. Just call it on a
  220.     regular basis and MUI will be able to handle
  221.     all actions concerning the GUI. You do not need
  222.     to pay attention on return values, they remain
  223.     on an internal stack until your next call to
  224.     the non buffered input method.
  225.  
  226.     EXAMPLE
  227.     for (track=0; track<80; track++)
  228.     {
  229.        read_track();
  230.        DoMethod(app,MUIM_Application_InputBuffered);
  231.        write_track();
  232.        DoMethod(app,MUIM_Application_InputBuffered);
  233.     }
  234.  
  235.     SEE ALSO
  236.     MUIM_Application_Input, MUIA_Application_Sleep
  237. Application.mui/MUIM_Application_Load
  238.  
  239.     NAME
  240.     MUIM_Application_Load
  241.  
  242.     SYNOPSIS
  243.     DoMethod(obj,MUIM_Application_Load,STRPTR name);
  244.  
  245.     FUNCTION
  246.     MUIM_Application_Save, MUIM_Application_Load and
  247.     MUIA_ExportID offer an easy way of saving and loading
  248.     a programs configuration.
  249.  
  250.     Each gadget with a non NULL MUIA_ExportID will get
  251.     its contents saved during MUIM_Application_Save and
  252.     restored during MUIM_Application_Load. This makes
  253.     it very easy to design a configuration window
  254.     with "Save", "Use" and "Cancel" buttons to allow
  255.     the user storing the settings. When the application
  256.     starts, you would just have to call MUIM_Application_Load
  257.     and the stored settings will be read and installed.
  258.  
  259.     Not all classes are able to import and export their
  260.     contents. Currently, you may define MUIA_ExportIDs for
  261.  
  262.     String class  - MUIA_String_Contents is ex/imported.
  263.     Radio class   - MUIA_Radio_Active is ex/imported.
  264.     Cycle class   - MUIA_Cycle_Active is ex/imported.
  265.     List class    - MUIA_List_Active is /ex/imported.
  266.     Text class    - MUIA_Text_Contents is ex/imported.
  267.     Slider class  - MUIA_Slider_Level is ex/imported.
  268.     Area class    - MUIA_Selected is ex/imported
  269.                     (e.g. for Checkmark gadgets)
  270.  
  271.     INPUTS
  272.     name - Name of the file you wish to load the settings from.
  273.            Usually you won't need to think of a real name but
  274.            instead use one of the magic cookies
  275.            MUIV_Application_Load_ENV or
  276.            MUIV_Application_Load_ENVARC.
  277.  
  278.     EXAMPLE
  279.     see the sample program "Settings.c"
  280.  
  281.     SEE ALSO
  282.     MUIM_Application_Save, MUIA_ExportID
  283. Application.mui/MUIM_Application_PushMethod
  284.  
  285.     NAME
  286.     MUIM_Application_PushMethod
  287.  
  288.     SYNOPSIS
  289.     DoMethod(obj,MUIM_Application_PushMethod,Object *dest, LONG count, /* ... */);
  290.  
  291.     FUNCTION
  292.     Usually, you may not talk to the MUI system from two
  293.     tasks at the same time. MUIM_Application_PushMethod
  294.     provides some kind of solution for this problem.
  295.  
  296.     This (and only this) method may be called from a
  297.     second task. It takes another method as parameter
  298.     and puts in onto a private stack of the application
  299.     object. The next time MUIM_Application_Input
  300.     is called, the pushed method will be executed
  301.     in the context of the current task.
  302.  
  303.     INPUTS
  304.     dest  - object on which to perform the pushed method.
  305.         count - number of following arguments.
  306.     ...   - the destination method.
  307.  
  308.     EXAMPLE
  309.     /* set a status line from a sub task */
  310.     DoMethod(app,MUIM_Application_PushMethod,
  311.        txstatus,3,MUIM_Set,MUIA_Text_Contents,"reading...");
  312.  
  313.     SEE ALSO
  314.     MUIM_Application_Input
  315. Application.mui/MUIM_Application_ReturnID
  316.  
  317.     NAME
  318.     MUIM_Application_ReturnID
  319.  
  320.     SYNOPSIS
  321.     DoMethod(obj,MUIM_Application_ReturnID,ULONG retid);
  322.  
  323.     FUNCTION
  324.     Tell MUI to return the given id with the next call to 
  325.     MUIM_Application_Input.
  326.  
  327.     Together with the MUI's notification mechanism, this
  328.     method connects your user interface and your program.
  329.     If you e.g. want to be informed if the user presses
  330.     a "Play" button, you would have define an id for
  331.     this action and set up a notification event with
  332.     MUIM_Notify.
  333.  
  334.     You can use any long word as return id, except
  335.     from -255 up to 0. These values are reserved for
  336.     MUI's internal use and for special return values
  337.     like MUIV_Application_ReturnID_Quit.
  338.  
  339.     Note that MUI will put all incoming return ids
  340.     onto a private fifo stack and feed this stack
  341.     to its input methods result code later.
  342.  
  343.     EXAMPLE
  344.  
  345.     /* inform me if a button is pressed (actually released, */
  346.     /* since this is the way amiga buttons are handled)     */
  347.  
  348.     #define ID_PLAYBUTTON 42
  349.  
  350.     ...
  351.  
  352.     DoMethod(buttonobj, MUIM_Notify,
  353.        MUIA_Pressed, FALSE,
  354.        appobj, 2, MUIM_Application_ReturndID, ID_PLAYBUTTON);
  355.  
  356.     ...
  357.  
  358.     while (running)
  359.     {
  360.        switch (DoMethod(appobj,MUIM_Application_Input,&sigs))
  361.        {
  362.           case ID_PLAYBUTTON:
  363.              printf("Ok, lets play a game...");
  364.              break;
  365.        }
  366.     }
  367.  
  368.     SEE ALSO
  369.     MUIM_Application_Input, MUIM_Notify
  370. Application.mui/MUIM_Application_Save
  371.  
  372.     NAME
  373.     MUIM_Application_Save
  374.  
  375.     SYNOPSIS
  376.     DoMethod(obj,MUIM_Application_Save,STRPTR name);
  377.  
  378.     FUNCTION
  379.     MUIM_Application_Save, MUIM_Application_Load and
  380.     MUIA_ExportID offer an easy way of saving and loading
  381.     a programs configuration.
  382.  
  383.     Each gadget with a non NULL MUIA_ExportID will get
  384.     its contents saved during MUIM_Application_Save and
  385.     restored during MUIM_Application_Load. This makes
  386.     it very easy to design a configuration window
  387.     with "Save", "Use" and "Cancel" buttons to allow
  388.     the user storing the settings. When the application
  389.     starts, you would just have to call MUIM_Application_Load 
  390.     and the stored settings will be read and installed.
  391.  
  392.     Not all classes are able to import and export their
  393.     contents. Currently, you may define MUIA_ExportIDs for
  394.  
  395.     String class  - MUIA_String_Contents is ex/imported.
  396.     Radio class   - MUIA_Radio_Active is ex/imported.
  397.     Cycle class   - MUIA_Cycle_Active is ex/imported.
  398.     List class    - MUIA_List_Active is /ex/imported.
  399.     Text class    - MUIA_Text_Contents is ex/imported.
  400.     Slider class  - MUIA_Slider_Level is ex/imported.
  401.     Area class    - MUIA_Selected is ex/imported
  402.                     (e.g. for Checkmark gadgets).
  403.  
  404.     INPUTS
  405.     name - Name of the file you wish to save the settings to.
  406.            Usually you won't need to think of a real name but
  407.            instead use one of the magic cookies
  408.            MUIV_Application_Save_ENV or
  409.            MUIV_Application_Save_ENVARC.
  410.            This will save your application's settings somewhere
  411.            in env:mui/ or envarc:mui/, you needn't worry about
  412.            it.
  413.  
  414.     EXAMPLE
  415.     see the sample program "Settings.c"
  416.  
  417.     SEE ALSO
  418.     MUIM_Application_Load, MUIA_ExportID
  419. Application.mui/MUIM_Application_SetMenuCheck
  420.  
  421.     NAME
  422.     MUIM_Application_SetMenuCheck
  423.  
  424.     SYNOPSIS
  425.     DoMethod(obj,MUIM_Application_SetMenuCheck,ULONG MenuID, LONG set);
  426.  
  427.     FUNCTION
  428.     Set or clear the checkmark of a menu item.
  429.     The application will ask its sub windows for menu items
  430.     with the given id and set/clear all found
  431.     entries.
  432.  
  433.     INPUTS
  434.     MenuID - the value you wrote into the
  435.                  UserData field of struct NewMenu.
  436.  
  437.     set    - TRUE to set checkmark, FALSE to clear
  438.  
  439.     SEE ALSO
  440.     MUIM_Application_GetMenuCheck, MUIA_Application_Menu,
  441. Application.mui/MUIM_Application_SetMenuState
  442.  
  443.     NAME
  444.     MUIM_Application_SetMenuState
  445.  
  446.     SYNOPSIS
  447.     DoMethod(obj,MUIM_Application_SetMenuState,ULONG MenuID, LONG set);
  448.  
  449.     FUNCTION
  450.     Enable or disable a menu item.
  451.     The application will ask its sub windows for menu items
  452.     with the given id and enable/disable all found
  453.     entries.
  454.  
  455.     INPUTS
  456.     MenuID - the value you wrote into the
  457.                  UserData field of struct NewMenu.
  458.  
  459.     set    - TRUE to enable item, FALSE to disable.
  460.  
  461.     SEE ALSO
  462.     MUIM_Application_GetMenuState, MUIA_Application_Menu,
  463. Application.mui/MUIM_Application_ShowHelp
  464.  
  465.     NAME
  466.     MUIM_Application_ShowHelp
  467.  
  468.     SYNOPSIS
  469.     DoMethod(obj,MUIM_Application_ShowHelp,Object *window, char *name, char *node, LONG line);
  470.  
  471.     FUNCTION
  472.     Show an AmigaGuide help file. The application will be
  473.     put to sleep until the file is displayed.
  474.  
  475.     Usually, you don't need to call this method directly.
  476.     MUI comes with a sophisticated online help system,
  477.     you just need to supply your gadgets with help nodes
  478.     and everything will be handled automatically.
  479.  
  480.     INPUTS
  481.     window - (Object *) - Help will appear on this windows
  482.                           screen. May be NULL.
  483.     name   - (char *)   - name of the help file
  484.     node   - (char *)   - name of a node in this help file
  485.     line   - (char *)   - line number
  486.  
  487.     SEE ALSO
  488.     MUIA_HelpFile, MUIA_HelpNode, MUIA_HelpLine
  489. Application.mui/MUIA_Application_Active
  490.  
  491.     NAME
  492.     MUIA_Application_Active -- [ISG], BOOL
  493.  
  494.     FUNCTION
  495.     This attribute reflects the state that the user adjusted
  496.     with commodities Exchange. MUI itself doesn't pay any
  497.     attention to it, this is up to you.
  498.  
  499.     SEE ALSO
  500.     MUIA_Application_Broker
  501. Application.mui/MUIA_Application_Author
  502.  
  503.     NAME
  504.     MUIA_Application_Author -- [I.G], STRPTR
  505.  
  506.     FUNCTION
  507.     Name of the applications author.
  508.  
  509.     EXAMPLE
  510.     see MUIA_Application_Title
  511.  
  512.     SEE ALSO
  513.     MUIA_Application_Title, MUIA_Application_Copyright,
  514.     MUIA_Application_Version, MUIA_Application_Description,
  515.     MUIA_Application_Base
  516. Application.mui/MUIA_Application_Base
  517.  
  518.     NAME
  519.     MUIA_Application_Base -- [I.G], STRPTR
  520.  
  521.     FUNCTION
  522.     The basename for an application. This name is used
  523.     for the builtin ARexx port and for some internal
  524.     file management.
  525.  
  526.     A basename must neither contain spaces nor any
  527.     special characters such as ":/()#?*...".
  528.  
  529.     When your program is a single task application
  530.     (i.e. MUIA_Application_SingleTask is TRUE), the
  531.     base name will be used without further modification.
  532.  
  533.     Otherwise, it gets a ".1", ".2", etc. appended,
  534.     depending on how many applications are already
  535.     running. If you need to know the name of your
  536.     ARexx port, you can query the base name attribute
  537.     after the application is created.
  538.  
  539.     EXAMPLE
  540.     see MUIA_Application_Title
  541.  
  542.     SEE ALSO
  543.     MUIA_Application_Title, MUIA_Application_Version,
  544.     MUIA_Application_Author, MUIA_Application_Copyright,
  545.     MUIA_Application_Description
  546. Application.mui/MUIA_Application_Broker
  547.  
  548.     NAME
  549.     MUIA_Application_Broker -- [..G], Broker *
  550.  
  551.     FUNCTION
  552.     If you need to attach some additional commodities objects
  553.     to your application (e.g. because you need lots of hotkeys),
  554.     you can obtain a pointer to the applications Broker structure
  555.     and add some commodities objects.
  556.     
  557.     MUI will free the complete broker when the application is
  558.     disposed, no need for you to free your objects yourself.
  559.  
  560.     To receive input from your objects, you will also need to
  561.     install a MUIA_Application_BrokerHook.
  562.  
  563.     SEE ALSO
  564.     MUIA_Application_BrokerHook
  565. Application.mui/MUIA_Application_BrokerHook
  566.  
  567.     NAME
  568.     MUIA_Application_BrokerHook -- [ISG], struct Hook *
  569.  
  570.     FUNCTION
  571.     You specify a pointer to hook structure. The function
  572.     will be called whenever a commodities message arrives
  573.     (between MUI's GetMsg() and ReplyMsg()).
  574.  
  575.     You receive a pointer to the application object
  576.     as object in a2 and a pointer to commodities
  577.     CxMsg message in a1.
  578.  
  579.     SEE ALSO
  580.     MUIA_Application_Broker
  581. Application.mui/MUIA_Application_BrokerPort
  582.  
  583.     NAME
  584.     MUIA_Application_BrokerPort -- [..G], struct MsgPort *
  585.  
  586.     FUNCTION
  587.     Get a pointer to the applications commodities message port.
  588.     If you want to add own Hotkeys to your application, you
  589.     need a message port. Instead of creating your own, you
  590.     should better use this one.
  591.  
  592.     SEE ALSO
  593.     MUIA_Application_BrokerHook
  594. Application.mui/MUIA_Application_BrokerPri
  595.  
  596.     NAME
  597.     MUIA_Application_BrokerPri -- [I.G], LONG
  598.  
  599.     FUNCTION
  600.     Adjust the priority of an applications broker.
  601.  
  602.     SEE ALSO
  603.     MUIA_Application_BrokerHook
  604. Application.mui/MUIA_Application_Commands
  605.  
  606.     NAME
  607.     MUIA_Application_Commands -- [ISG], struct MUI_Command *
  608.  
  609.     FUNCTION
  610.     This attribute allows an application to include 
  611.     its own set of ARexx commands. You specify a
  612.     pointer to an array of MUI_Command structures,
  613.     which look like this:
  614.  
  615.     struct MUI_Command
  616.     {
  617.        char        *mc_Name;
  618.        char        *mc_Template;
  619.        LONG         mc_Parameters;
  620.        struct Hook *mc_Hook;
  621.        LONG         mc_Reserved[5];
  622.     };
  623.  
  624.     mc_Name       contains the name of your command.
  625.                   Commands are not case sensitive.
  626.  
  627.     mc_Template   is an argument template that follows
  628.                   the same rules as dos.library/ReadArgs().
  629.                   It may be NULL, in which case your command
  630.                   doesn't need any parameters.
  631.  
  632.     mc_Parameters is the number of parameters specified
  633.                   in the template array.
  634.  
  635.     mc_Hook       is a pointer to the callback hook defining
  636.                   the function to be called.
  637.  
  638.     You may specify any number of MUI_Command structures,
  639.     but you must terminate your array with a NULL field.
  640.  
  641.     When a command shows up an applications ARexx port,
  642.     MUI parses the arguments according to the given
  643.     template and calls the hook with the application
  644.     object as hook object in a2 and a pointer to
  645.     an array of longwords containing the parameters
  646.     in a1.
  647.  
  648.     The result code of your hook will be replied to
  649.     ARexx as rc.
  650.  
  651.     If you have some simple ARexx commands that just
  652.     emulate some user action (e.g. clicking a button),
  653.     you can use the magic cookie MC_TEMPLATE_ID for 
  654.     mc_Template and a return id value for mc_Parameters. 
  655.     In this case, MUI will do no argument parsing and 
  656.     instead simply return the specified id value on the 
  657.     next call to MUIM_Application_Input.
  658.  
  659.     For more sophisticated possibilities in ARexx
  660.     callback hooks, please refer to
  661.     MUIA_Application_RexxMsg and MUIA_Application_RexxString.
  662.  
  663.     EXAMPLE
  664.     static struct MUI_Command commands[] =
  665.     {
  666.        { "rescan", MC_TEMPLATE_ID, ID_RESCAN, NULL     },
  667.        { "select", "PATTERN/A"   , 1        , &selhook },
  668.        { NULL    , NULL          , NULL     , NULL     }
  669.     };
  670.  
  671.     SEE ALSO
  672.     MUIA_Application_RexxMsg, MUIA_Application_RexxString
  673. Application.mui/MUIA_Application_Copyright
  674.  
  675.     NAME
  676.     MUIA_Application_Copyright -- [I.G], STRPTR
  677.  
  678.     FUNCTION
  679.     A copyright string, containing the year and the
  680.     company.
  681.  
  682.     EXAMPLE
  683.     see MUIA_Application_Title
  684.  
  685.     SEE ALSO
  686.     MUIA_Application_Title, MUIA_Application_Version,
  687.     MUIA_Application_Author, MUIA_Application_Description,
  688.     MUIA_Application_Base
  689. Application.mui/MUIA_Application_Description
  690.  
  691.     NAME
  692.     MUIA_Application_Description -- [I.G], STRPTR
  693.  
  694.     FUNCTION
  695.     Short description, about 40 characters.
  696.     Shown e.g. in commodities exchange.
  697.  
  698.     EXAMPLE
  699.     see MUIA_Application_Title
  700.  
  701.     SEE ALSO
  702.     MUIA_Application_Title, MUIA_Application_Version,
  703.     MUIA_Application_Author, MUIA_Application_Copyright,
  704.     MUIA_Application_Base
  705. Application.mui/MUIA_Application_DiskObject
  706.  
  707.     NAME
  708.     MUIA_Application_DiskObject -- [ISG], struct DiskObject *
  709.  
  710.     FUNCTION
  711.     Pointer to a struct DiskObject, e.g. obtained
  712.     from GetDiskObject(). If present, MUI will use
  713.     this object for the AppIcon when your application
  714.     gets iconified.
  715.  
  716.     Otherwise MUI will try to locate "env:sys/dev_mui.info"
  717.     and, if not present, fall back to a default icon.
  718.  
  719.     EXAMPLE
  720.     ...
  721.     MUIA_Application_DiskObject, 
  722.        dobj = GetDiskObject("PROGDIR:MyApp"),
  723.     ...
  724.  
  725.     /* note that you have to free dobj yourself! */
  726.  
  727.    SEE ALSO
  728.     MUIA_Application_Iconified
  729. Application.mui/MUIA_Application_DoubleStart
  730.  
  731.     NAME
  732.     MUIA_Application_DoubleStart -- [..G], BOOL
  733.  
  734.     FUNCTION
  735.     This attribute is set automatically when the user
  736.     tries to start a MUIA_SingleTask application twice.
  737.     You can react on this and take appropriate actions,
  738.     e.g. pop up a requester or quit yourself.
  739.  
  740.     SEE ALSO
  741.     MUIA_Application_SingleTask
  742. Application.mui/MUIA_Application_DropObject
  743.  
  744.     NAME
  745.     MUIA_Application_DropObject -- [IS.], Object *
  746.  
  747.     FUNCTION
  748.     If your application is iconified and the user drops
  749.     icons onto the AppIcon, the object specified here will 
  750.     receive the AppMessage.
  751.  
  752.     SEE ALSO
  753.     MUIA_Window_AppWindow, MUIM_CallHook
  754. Application.mui/MUIA_Application_Iconified
  755.  
  756.     NAME
  757.     MUIA_Application_Iconified -- [.SG], BOOL
  758.  
  759.     FUNCTION
  760.     Setting this attribute to TRUE causes the application
  761.     to become iconified. Every open window will be closed
  762.     and a (configurable) AppIcon will appear on the workbench.
  763.  
  764.     Same thing happens when the user hits the iconify gadget
  765.     in the window border or uses commodities Exchange to
  766.     hide your applications interface.
  767.  
  768.     There is no way for you to prevent your application from
  769.     being iconified. However, you can react on the iconification
  770.     by listening to the MUIA_Application_Iconified attribute
  771.     with notification. This allows you to free some resources
  772.     you don't need in iconified state.
  773.  
  774.     When an application is iconified and you try to open a
  775.     window, the window won't open immediately. Instead MUI
  776.     remembers this action and opens the window once the
  777.     application is uniconified again.
  778.  
  779.     EXAMPLE
  780.  
  781.     /* inform the main input loop of iconification events */
  782.  
  783.     #define ID_HIDE 42
  784.     #define ID_SHOW 24
  785.  
  786.     DoMethod(app,MUIM_Notify,
  787.        MUIA_Application_Iconified, TRUE,
  788.        app, 2, MUIM_Application_ReturnID, ID_HIDE);
  789.  
  790.     DoMethod(app,MUIM_Notify,
  791.        MUIA_Application_Iconified, FALSE,
  792.        app, 2, MUIM_Application_ReturnID, ID_SHOW);
  793.  
  794.     SEE ALSO
  795.     MUIA_DiskObject
  796. Application.mui/MUIA_Application_Menu
  797.  
  798.     NAME
  799.     MUIA_Application_Menu -- [I.G], struct NewMenu *
  800.  
  801.     FUNCTION
  802.     You can define a global menu for all the windows
  803.     in your application. Whenever a new window is
  804.     opened, it gets its menu from this place
  805.     as long as the window doesn't define its own menu.
  806.  
  807.     The attribute points to a conventional NewMenu
  808.     structure array from gadtools. You might want to
  809.     fill the UserData field of a NewMenu entry width
  810.     an id value. This id will be returned through
  811.     the applications input method when the
  812.     corresponding menu item is selected.
  813.  
  814.     Selecting a menu item might also trigger
  815.     MUIA_Application_MenuAction and MUIA_Application_MenuHelp.
  816.  
  817.     EXAMPLE
  818.  
  819.     #define ID_ABOUT 1
  820.     #define ID_QUIT  MUIV_Application_ReturnID_Quit
  821.  
  822.     struct NewMenu NewMenu[] =
  823.     {
  824.        { NM_TITLE, "Project"  , 0 ,0,0,(APTR)0        },
  825.        { NM_ITEM , "About..." ,"?",0,0,(APTR)ID_ABOUT },
  826.        { NM_ITEM , NM_BARLABEL, 0 ,0,0,(APTR)0        },
  827.        { NM_ITEM , "Quit"     ,"Q",0,0,(APTR)ID_QUIT  },
  828.        { NM_END  , NULL       , 0 ,0,0,(APTR)0        },
  829.     };
  830.  
  831.     ApplicationObject,
  832.        ...,
  833.        MUIA_Application_Menu, NewMenu,
  834.        ...
  835.  
  836.     SEE ALSO
  837.     MUIA_Application_Input, MUIA_Window_Menu,
  838.     MUIA_Application_MenuAction, MUIA_Application_MenuHelp
  839. Application.mui/MUIA_Application_MenuAction
  840.  
  841.     NAME
  842.     MUIA_Application_MenuAction -- [..G], ULONG
  843.  
  844.     FUNCTION
  845.     Whenever a menu item is selected, this attribute will be
  846.     set to the corresponding UserData field of the gadtools
  847.     NewMenu structure. This allows reacting on menu items
  848.     via broadcasting.
  849.  
  850.     SEE ALSO
  851.     MUIA_Application_Menu, MUIA_Application_MenuAction
  852. Application.mui/MUIA_Application_MenuHelp
  853.  
  854.     NAME
  855.     MUIA_Application_MenuHelp -- [..G], ULONG
  856.  
  857.     FUNCTION
  858.     Whenever a menu item is selected with the help key, this
  859.     attribute will be set to the corresponding UserData field
  860.     of the gadtools NewMenu structure. Together with
  861.     MUIM_Application_ShowHelp this allows creation of
  862.     menu help texts.
  863.  
  864.     SEE ALSO
  865.     MUIA_Application_Menu, MUIA_Application_ShowHelp
  866. Application.mui/MUIA_Application_RexxMsg
  867.  
  868.     NAME
  869.     MUIA_Application_RexxMsg -- [..G], struct RxMsg *
  870.  
  871.     FUNCTION
  872.     Within an ARexx callback hook, you can obtain
  873.     a pointer to the RexxMsg that came with the
  874.     command. This allows you to use some ARexx
  875.     support functions coming with amiga.lib
  876.  
  877.     SEE ALSO
  878.     MUIA_Application_Commands, MUIA_Application_RexxString
  879. Application.mui/MUIA_Application_RexxString
  880.  
  881.     NAME
  882.     MUIA_Application_RexxString -- [.S.], STRPTR
  883.  
  884.     FUNCTION
  885.     ARexx allows returning a string as result of a
  886.     function call. This attribute allows setting the
  887.     result string within an ARexx callback hook.
  888.  
  889.     The string is temporarily copied.
  890.  
  891.     SEE ALSO
  892.     MUIA_Application_Commands, MUIA_Application_RexxMsg
  893. Application.mui/MUIA_Application_SingleTask
  894.  
  895.     NAME
  896.     MUIA_Application_SingleTask -- [I..], BOOL
  897.  
  898.     FUNCTION
  899.     Boolean value to indicate whether or not your application
  900.     is a single task program. When set to TRUE, MUI will
  901.     refuse to create more than one application object.
  902.  
  903.     In this case, the already running application gets its
  904.     MUIA_DoubleStart attribute set to TRUE. You can listen
  905.     to this and take appropriate actions, e.g. pop up
  906.     a requester.
  907.  
  908.     Examples for single task applications are the system
  909.     preferences program. It doesn't make sense for them
  910.     to run more than once.
  911.  
  912.     SEE ALSO
  913.     MUIA_Application_DoubleStart
  914. Application.mui/MUIA_Application_Sleep
  915.  
  916.     NAME
  917.     MUIA_Application_Sleep -- [.S.], BOOL
  918.  
  919.     FUNCTION
  920.     This attribute can be used to put a whole application
  921.     to sleep. All open windows get disabled and a busy
  922.     pointer appears.
  923.  
  924.     This attribute contains a nesting count, if you tell
  925.     your application to sleep twice, you will have to tell 
  926.     it to wake up twice too.
  927.  
  928.     If you need to do some time consuming actions, you
  929.     always should set this attribute to inform the user
  930.     that you are currently unable to handle input.
  931.  
  932.     A sleeping application's windows cannot be resized.
  933.  
  934.     EXAMPLES
  935.     set(app,MUIA_Application_Sleep,TRUE ); // go to bed
  936.     calc_fractals();
  937.     set(app,MUIA_Application_Sleep,FALSE); // wake up
  938.  
  939.     SEE ALSO
  940.     MUIA_Window_Sleep, MUIM_Application_InputBuffered
  941. Application.mui/MUIA_Application_Title
  942.  
  943.     NAME
  944.     MUIA_Application_Title -- [I.G], STRPTR
  945.  
  946.     FUNCTION
  947.     This tag defines the title of an application.
  948.     The title is e.g. shown in Commodities Exchange
  949.     or in the MUI preferences program.
  950.  
  951.     An application title shall not contain any version
  952.     information, just the pure title. Also, special
  953.     characters such as ":/()#?*..." are not allowed.
  954.  
  955.     You should use a quiet long and unique name for
  956.     your applications. Naming it "Viewer" or "Browser"
  957.     is not a wise choice.
  958.  
  959.     The length of the name must not exceed 30 characters!
  960.  
  961.     EXAMPLE
  962.     ApplicationObject,
  963.        MUIA_Application_Title      , "WbMan",
  964.        MUIA_Application_Version    , "$VER: WbMan 0.24 (19.7.93)",
  965.        MUIA_Application_Copyright  ,á"⌐ 1993 by Klaus Melchior",
  966.        MUIA_Application_Author     ,á"Klaus Melchior",
  967.        MUIA_Application_Description,á"Manages the WBStartup.",
  968.        MUIA_Application_Base       ,á"WBMAN",
  969.        ...
  970.  
  971.     SEE ALSO
  972.     MUIA_Application_Version, MUIA_Application_Copyright,
  973.     MUIA_Application_Author, MUIA_Application_Description,
  974.     MUIA_Application_Base
  975. Application.mui/MUIA_Application_Version
  976.  
  977.     NAME
  978.     MUIA_Application_Version -- [I.G], STRPTR
  979.  
  980.     FUNCTION
  981.     Define a version string for an application.
  982.     This string shall follow standard version string
  983.     convetions but must *not* contain a leading "\0".
  984.  
  985.     EXAMPLE
  986.     see MUIA_Application_Title
  987.  
  988.     SEE ALSO
  989.     MUIA_Application_Title, MUIA_Application_Copyright,
  990.     MUIA_Application_Author, MUIA_Application_Description,
  991.     MUIA_Application_Base
  992. Application.mui/MUIA_Application_Window
  993.  
  994.     NAME
  995.     MUIA_Application_Window -- [I..], Object *
  996.  
  997.     FUNCTION
  998.     A pointer to a MUI object of Window class. An
  999.     application may have any number of sub windows,
  1000.     each of them being a child of the application.
  1001.  
  1002.     When the application receives some kind of user
  1003.     input through its IDCMP, it diverts the message
  1004.     down to its children, as long as they are opened.
  1005.  
  1006.     Things like iconification or preferences changes
  1007.     cause the application object to temporarily close
  1008.     every open window (and reopen it later). Your
  1009.     main program normally doesn't need to deal with
  1010.     these things.
  1011.  
  1012.     As with the children of group class, it's common
  1013.     to use a call to MUI_NewObject() as value for
  1014.     this attribute. No error checking needs to be
  1015.     done, the application object handles every
  1016.     failure automatically.
  1017.  
  1018.     When you dispose your application, its sub windows
  1019.     will also get deleted. Thus, the only thing to do
  1020.     to remove your application is a
  1021.  
  1022.     MUI_DisposeObject(ApplicationObject);
  1023.  
  1024.     Every window, every gadget, every memory will be
  1025.     freed by this single call.
  1026.  
  1027.     EXAMPLE
  1028.     Please refer to one of the example programs.
  1029.  
  1030.     SEE ALSO
  1031.